WPS Office.apk(点击下载) / eyk.java


package defpackage;

import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.DownloadListener;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;
import cn.wps.moffice.OfficeApp;
import cn.wps.moffice.common.beans.MaterialProgressBarCycle;
import cn.wps.moffice.common.multi.droplist.MultiButtonForHome;
import cn.wps.moffice.define.VersionManager;
import cn.wps.moffice.framework.util.SoftKeyboardUtil;
import cn.wps.moffice.main.common.viewcontrols.ViewTitleBar;
import cn.wps.moffice.main.push.common.JSCustomInvoke;
import cn.wps.moffice_eng.R;
import defpackage.czq;
import defpackage.eip;
import defpackage.eym;
import defpackage.eyp;
import java.util.ArrayList;

/* renamed from: eyk  reason: default package */
public class eyk extends czq.a implements View.OnClickListener, TextView.OnEditorActionListener {
    protected String cEf;
    protected MaterialProgressBarCycle dXF;
    private View eCE;
    private ViewGroup fqT;
    protected ViewGroup fqU;
    protected ViewGroup fqV;
    protected ViewGroup fqW;
    protected ViewGroup fqX;
    protected FrameLayout fqY;
    protected View fqZ;
    public eym.b frA;
    protected View fra;
    protected View frb;
    protected View frc;
    protected CheckBox frd;
    protected TextView fre;
    protected TextView frf;
    protected EditText frg;
    protected EditText frh;
    protected TextView fri;
    protected String frj;
    protected WebView frk;
    protected View frl;
    protected View frm;
    protected TextView frn;
    protected View fro;
    protected glp frp;
    private eyp frq;
    public a frr;
    protected boolean frs;
    protected ArrayList<glo> frt;
    protected int fru;
    public boolean frv;
    private String frw;
    private String frx;
    protected String fry;
    public boolean frz;
    public Context mContext;
    protected View mRootView;
    private ViewTitleBar mTitleBar;
    private TextView zo;

    /* renamed from: eyk$a */
    public interface a {
        boolean a(String str, boolean z, boolean z2, String str2, String str3, boolean z3, boolean z4, int i);

        boolean a(String str, boolean z, boolean z2, String str2, boolean z3, int i);

        String bsc();

        String bsd();

        void bse();

        boolean bsf();

        String getExtraInfo();

        String getFileName();
    }

    public eyk(Context context, int i) {
        super(context, i);
        this.mContext = null;
        this.frs = false;
        this.frt = new ArrayList<>();
        this.fru = 0;
        this.frA = new eym.b() {
            /* class defpackage.eyk.AnonymousClass9 */

            @Override // defpackage.eym.b
            public final void sendFeedbackInfo(String str, String str2, String str3, String str4, String str5, String str6, String str7, int i) {
                OfficeApp.arx().arN().q(eyk.this.mContext, "feedback_feedback");
                if ((!VersionManager.aYQ() || !eyr.bso()) && !lvq.hj(eyk.this.mContext)) {
                    lvg.d(eyk.this.mContext, R.string.documentmanager_noEmailApp, 1);
                    return;
                }
                eyk.this.brS();
                eyk.a(eyk.this, str, str2, str3, str4, str5, str6, str7, i);
                if (eyk.this.frr != null) {
                    eyk.this.fre.setText(eyk.this.frr.getFileName());
                    eyk.this.frf.setText(eyk.this.frr.bsd());
                    boolean bsf = eyk.this.frr.bsf();
                    eyk.this.fqU.findViewById(R.id.select_file_layout).setVisibility(bsf ? 0 : 8);
                    eyk.this.frd.setChecked(bsf);
                }
                eyk.this.fqT.removeAllViews();
                eyk.this.fqT.addView(eyk.this.fqU);
            }
        };
        this.mContext = context;
        disableCollectDialogForPadPhone();
    }

    public eyk(Context context, int i, String str, String str2, String str3) {
        this(context, i);
        this.frw = str;
        this.frx = str2;
        this.fry = str3;
    }

    static /* synthetic */ void a(eyk eyk, String str, String str2, String str3, String str4, String str5, String str6, String str7, int i) {
        eyk.frd.setChecked(true);
        if (eyk.frr != null) {
            eyk.frg.setText(eyk.frr.bsc());
        } else {
            eyk.frg.setText("");
        }
        eyk.frg.setHint(str4);
        eyk.frh.setVisibility(8);
        eyk.frh.setText("");
        if (!TextUtils.isEmpty(str5) && VersionManager.aYQ() && eyr.bso()) {
            eyk.frh.setHint(str5);
            eyk.frh.setVisibility(0);
        }
        eyk.fru = i;
        eyk.frd.setText(str6);
        eyk.frj = str3;
        eyk.cEf = str;
        if ("true".equalsIgnoreCase(str7)) {
            eyk.frs = true;
        } else {
            eyk.frs = false;
        }
        eyk.zo.setText(str);
        if (!TextUtils.isEmpty(str2)) {
            eyk.fri.setText(str2);
            eyk.fra.setOnClickListener(eyk);
            eyk.fra.setVisibility(0);
        } else {
            eyk.fri.setText("");
            eyk.fra.setVisibility(8);
        }
        if (eyk.frr != null) {
            String fileName = eyk.frr.getFileName();
            String bsd = eyk.frr.bsd();
            if (fileName == null) {
                eyk.fre.setVisibility(8);
            } else {
                eyk.fre.setVisibility(0);
                eyk.fre.setText(fileName);
            }
            if (bsd == null) {
                eyk.frf.setVisibility(4);
            } else {
                eyk.frf.setVisibility(0);
                eyk.frf.setText(bsd);
            }
        }
        if (!TextUtils.isEmpty(str6)) {
            eyk.frn.setText(str6);
        }
    }

    private boolean brY() {
        return this.frf.getVisibility() == 0;
    }

    private void brZ() {
        try {
            ebj.c(this.frk);
            this.frk.setWebChromeClient(new WebChromeClient() {
                /* class defpackage.eyk.AnonymousClass3 */

                public final void onProgressChanged(WebView webView, int i) {
                    if (i > 90 && eyk.this.dXF != null && eyk.this.dXF.getVisibility() == 0) {
                        eyk.this.dXF.setVisibility(8);
                    }
                    super.onProgressChanged(webView, i);
                }
            });
            this.frk.setWebViewClient(new WebViewClient() {
                /* class defpackage.eyk.AnonymousClass4 */

                public final void onPageFinished(WebView webView, String str) {
                    super.onPageFinished(webView, str);
                }

                public final void onPageStarted(WebView webView, String str, Bitmap bitmap) {
                    super.onPageStarted(webView, str, bitmap);
                }

                public final void onReceivedError(WebView webView, int i, String str, String str2) {
                    try {
                        super.onReceivedError(webView, i, str, str2);
                        if (eyk.this.dXF != null) {
                            eyk.this.dXF.setVisibility(8);
                        }
                    } catch (Resources.NotFoundException e) {
                        e.printStackTrace();
                    }
                }

                @Override // android.webkit.WebViewClient
                public final boolean shouldOverrideUrlLoading(WebView webView, String str) {
                    if (str.startsWith("mailto:")) {
                        try {
                            Intent intent = new Intent("android.intent.action.SENDTO");
                            intent.setData(Uri.parse(str));
                            webView.getContext().startActivity(intent);
                            return true;
                        } catch (Exception e) {
                            return true;
                        }
                    } else if (str.equals("http://wps.com/pc.install/") || str.equals("https://wps.com/pc.install/")) {
                        eyk.this.mContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
                        return true;
                    } else if (str.toLowerCase().startsWith("http:") || str.toLowerCase().startsWith("https:")) {
                        return false;
                    } else {
                        try {
                            eyk.this.mContext.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
                            return true;
                        } catch (Exception e2) {
                            return true;
                        }
                    }
                }
            });
            this.frk.setDownloadListener(new DownloadListener() {
                /* class defpackage.eyk.AnonymousClass5 */

                public final void onDownloadStart(String str, String str2, String str3, String str4, long j) {
                    try {
                        hdy.bl(eyk.this.frk.getContext(), str);
                    } catch (Exception e) {
                    }
                }
            });
            this.frk.setOnLongClickListener(new View.OnLongClickListener() {
                /* class defpackage.eyk.AnonymousClass6 */

                public final boolean onLongClick(View view) {
                    return true;
                }
            });
            JSCustomInvoke jSCustomInvoke = new JSCustomInvoke();
            jSCustomInvoke.setJsCallback(new hac(this.mContext, this.frk, this.dXF));
            this.frk.addJavascriptInterface(jSCustomInvoke, "feedback");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private String getContent() {
        String extraInfo = this.frr.getExtraInfo();
        return extraInfo == null ? this.frg.getText().toString() : extraInfo + this.frg.getText().toString();
    }

    /* access modifiers changed from: private */
    /* access modifiers changed from: public */
    private void kf(boolean z) {
        if (this.frr.a(this.cEf, this.frd.isChecked(), brY(), getContent(), this.frh.getText().toString(), z, this.frs, this.fru)) {
            brV();
        }
    }

    public void a(WindowManager.LayoutParams layoutParams) {
        if (!luf.gY(this.mContext)) {
            layoutParams.windowAnimations = cn.wps.moffice.R.style.Animations_push_left_in_right_out;
        }
    }

    public void brS() {
        this.fqZ = this.fqU.findViewById(R.id.select_file_layout);
        this.frd = (CheckBox) this.fqU.findViewById(R.id.select_all_files_box);
        this.fre = (TextView) this.fqU.findViewById(R.id.select_file_path_box);
        this.frf = (TextView) this.fqU.findViewById(R.id.select_pic_box);
        this.frc = this.fqU.findViewById(R.id.send_email);
        this.frc.setOnClickListener(this);
        this.fri = (TextView) this.fqU.findViewById(R.id.feedback_help_tips);
        this.fra = this.fqU.findViewById(R.id.feedback_help_tips_layout);
        this.frm = this.fqU.findViewById(R.id.add_document_layout_viewgroup);
        this.frl = this.fqU.findViewById(R.id.add_document_layout);
        this.frn = (TextView) this.fqU.findViewById(R.id.add_document_text);
        this.frg = (EditText) this.fqU.findViewById(R.id.input_content);
        this.frg.addTextChangedListener(new TextWatcher() {
            /* class defpackage.eyk.AnonymousClass10 */

            public final void afterTextChanged(Editable editable) {
            }

            public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            }

            public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
                if (charSequence.length() == 300) {
                    lvg.a(eyk.this.mContext, eyk.this.mContext.getResources().getString(R.string.public_feedback_max_text_len_tips), 0);
                }
            }
        });
        this.frg.setOnTouchListener(new View.OnTouchListener() {
            /* class defpackage.eyk.AnonymousClass11 */

            public final boolean onTouch(View view, MotionEvent motionEvent) {
                if (view.getId() == R.id.input_content) {
                    view.getParent().requestDisallowInterceptTouchEvent(true);
                    switch (motionEvent.getAction() & 255) {
                        case 1:
                            view.getParent().requestDisallowInterceptTouchEvent(false);
                            break;
                    }
                }
                return false;
            }
        });
        this.frh = (EditText) this.fqU.findViewById(R.id.input_contact_content);
        this.fqU.findViewById(R.id.wps_secrect_tips).setOnClickListener(new View.OnClickListener() {
            /* class defpackage.eyk.AnonymousClass12 */

            public final void onClick(View view) {
                new cvp(eyk.this.getContext(), "flow_tip_privacy_policy", VersionManager.aYa()) {
                    /* class defpackage.eyk.AnonymousClass12.AnonymousClass1 */

                    @Override // defpackage.cvp
                    public final void avf() {
                        eyk.this.brX();
                    }
                };
            }
        });
        if (this.frr != null) {
            this.fre.setText(this.frr.getFileName());
            this.frf.setText(this.frr.bsd());
        }
    }

    public void brT() {
        if (this.fqT.getChildAt(0) == this.fqU) {
            this.fqT.removeAllViews();
            this.fqT.addView(this.frq.bsn().getMainView());
            this.zo.setText(this.frz ? R.string.public_feedback_item : R.string.public_feedback_title);
        }
    }

    /* access modifiers changed from: protected */
    public final void brU() {
        if (this.fqT.getChildAt(0) == this.fqU) {
            this.fqW.setVisibility(0);
            this.fqT.removeAllViews();
            this.fqT.addView(this.fqW);
            this.zo.setText("");
        }
    }

    /* access modifiers changed from: protected */
    public final void brV() {
        if (this.dXF != null) {
            this.dXF.setVisibility(0);
        }
        fzc.bJM().c(new Runnable() {
            /* class defpackage.eyk.AnonymousClass2 */

            public final void run() {
                eyk.this.dXF.setVisibility(8);
                eyk.this.brU();
            }
        }, 2000);
    }

    /* access modifiers changed from: protected */
    public final void brW() {
        this.frt.clear();
        if (this.fqX != null) {
            this.fqX.removeAllViews();
        }
    }

    public void brX() {
        if (this.frr != null) {
            this.frr.bse();
        }
    }

    public void onClick(View view) {
        boolean z = true;
        switch (view.getId()) {
            case R.id.feedback_help_tips_layout /*{ENCODED_INT: 2131363656}*/:
                if (TextUtils.isEmpty(this.frj)) {
                    return;
                }
                if (lwd.hu(this.mContext)) {
                    this.frk = new WebView(this.mContext);
                    brZ();
                    this.fqV.removeAllViews();
                    this.frk.setFocusable(true);
                    ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(-1, -1);
                    this.frk.setLayoutParams(layoutParams);
                    this.fqV.addView(this.frk, layoutParams);
                    this.fqV.setVisibility(0);
                    this.fqU.setVisibility(8);
                    ebj.mK(this.frj);
                    this.frk.loadUrl(this.frj);
                    this.fqT.removeAllViews();
                    this.fqT.addView(this.fqV);
                    if (this.dXF != null) {
                        this.dXF.setVisibility(0);
                        return;
                    }
                    return;
                }
                lvg.d(this.mContext, R.string.public_noserver, 0);
                return;
            case R.id.send_email /*{ENCODED_INT: 2131367980}*/:
                if (!lwd.hu(this.mContext)) {
                    lvg.d(this.mContext, R.string.public_noserver, 0);
                    return;
                } else if (this.frr == null) {
                    return;
                } else {
                    if (!VersionManager.aYQ() || !eyr.bso()) {
                        this.frr.a(this.cEf, this.frd.isChecked(), brY(), getContent(), this.frs, this.fru);
                        return;
                    } else if (!lwd.isWifiConnected(this.mContext)) {
                        czq czq = new czq(this.mContext);
                        czq.setMessage(R.string.home_download_no_wifi_warn);
                        czq.setPositiveButton(R.string.feedback_upload_confirm, new DialogInterface.OnClickListener() {
                            /* class defpackage.eyk.AnonymousClass13 */

                            public final void onClick(DialogInterface dialogInterface, int i) {
                                dialogInterface.dismiss();
                                eyk.this.kf(true);
                            }
                        });
                        czq.setNegativeButton(R.string.feedback_upload_wifi, new DialogInterface.OnClickListener() {
                            /* class defpackage.eyk.AnonymousClass14 */

                            public final void onClick(DialogInterface dialogInterface, int i) {
                                dialogInterface.dismiss();
                                eyk.this.kf(false);
                            }
                        });
                        czq.show();
                        return;
                    } else {
                        kf(true);
                        return;
                    }
                }
            case R.id.titlebar_backbtn /*{ENCODED_INT: 2131368677}*/:
                if (this.dXF != null && this.dXF.getVisibility() == 0) {
                    this.dXF.setVisibility(8);
                }
                SoftKeyboardUtil.aB(view);
                if (this.frv) {
                    dismiss();
                    return;
                } else if (this.fqT.getChildAt(0) == this.fqW) {
                    if (this.fqT.getChildAt(0) == this.fqW) {
                        this.fqW.setVisibility(8);
                        this.fqT.removeAllViews();
                        this.fqT.addView(this.frq.bsn().getMainView());
                        this.zo.setText(this.frz ? R.string.public_feedback_item : R.string.public_feedback_title);
                        brW();
                        return;
                    }
                    return;
                } else if (this.fqT.getChildAt(0) == this.fqV) {
                    if (this.frk.canGoBack()) {
                        this.frk.goBack();
                    } else {
                        z = false;
                    }
                    if (!z) {
                        this.fqV.setVisibility(8);
                        this.fqU.setVisibility(0);
                        this.fqV.removeAllViews();
                        this.fqT.removeAllViews();
                        this.fqT.addView(this.fqU);
                        if (this.dXF != null) {
                            this.dXF.setVisibility(8);
                            return;
                        }
                        return;
                    }
                    return;
                } else if (this.fqT.getChildAt(0) == this.fqU) {
                    brT();
                    return;
                } else {
                    eym bsn = this.frq.bsn();
                    if (bsn.frG.canGoBack()) {
                        bsn.frG.goBack();
                    } else {
                        z = false;
                    }
                    if (!z) {
                        dismiss();
                        return;
                    }
                    return;
                }
            default:
                return;
        }
    }

    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        LayoutInflater layoutInflater = (LayoutInflater) this.mContext.getSystemService("layout_inflater");
        if (luf.gR(this.mContext)) {
            this.mRootView = layoutInflater.inflate(R.layout.public_help_or_suggestion_dialog_pad, (ViewGroup) null);
        } else {
            this.mRootView = layoutInflater.inflate(R.layout.public_help_or_suggestion_dialog, (ViewGroup) null);
        }
        getWindow().setSoftInputMode(16);
        setContentView(this.mRootView, new ViewGroup.LayoutParams(-1, -1));
        a(getWindow().getAttributes());
        this.fqY = (FrameLayout) this.mRootView.findViewById(R.id.content_parent);
        this.mTitleBar = (ViewTitleBar) this.mRootView.findViewById(R.id.titlebar);
        this.mTitleBar.setTitleText(this.frz ? R.string.public_feedback_item : R.string.public_feedback_title);
        this.mTitleBar.gBP.setMultiButtonForHomeCallback(new MultiButtonForHome.a() {
            /* class defpackage.eyk.AnonymousClass1 */

            @Override // cn.wps.moffice.common.multi.droplist.MultiButtonForHome.a
            public final boolean auh() {
                return false;
            }
        });
        this.fqT = (ViewGroup) this.mRootView.findViewById(R.id.content);
        this.fqU = (ViewGroup) this.mRootView.findViewById(R.id.suggestion_content);
        this.fqV = (ViewGroup) this.mRootView.findViewById(R.id.public_feedback_second_content);
        this.fqW = (ViewGroup) this.mRootView.findViewById(R.id.public_thanks_page);
        this.frb = this.mTitleBar.gBH;
        this.frb.setOnClickListener(new View.OnClickListener() {
            /* class defpackage.eyk.AnonymousClass7 */

            public final void onClick(View view) {
                gec.vx("public_is_search_help");
                gec.x(eyk.this.mContext, "", "feedback");
            }
        });
        lwz.d(this.frb, this.mContext.getString(R.string.documentmanager_history_record_search));
        this.fqW.setVisibility(8);
        this.frq = new eyp((Activity) this.mContext, this.frw, new eyp.a() {
            /* class defpackage.eyk.AnonymousClass8 */

            @Override // defpackage.eyp.a
            public final void bsa() {
                if (gec.bMW() && TextUtils.isEmpty(eyk.this.fry)) {
                    eyk.this.frb.setVisibility(0);
                }
            }

            @Override // defpackage.eyp.a
            public final void bsb() {
                eyk.this.frb.setVisibility(8);
            }
        });
        eym bsn = this.frq.bsn();
        bsn.dXF.setVisibility(0);
        bsn.frH.setVisibility(0);
        this.fqT.removeAllViews();
        this.eCE = this.mTitleBar.gBO;
        this.mTitleBar.gBE.setBackgroundColor(this.mContext.getResources().getColor(cxg.c(cqt.asE())));
        if (cqt.asE() == eip.a.appID_presentation || cqt.asE() == eip.a.appID_home) {
            this.mTitleBar.setStyle(1);
        }
        this.fqT.addView(this.frq.bsn().getMainView(), new ViewGroup.LayoutParams(-1, -1));
        this.fqT.setVisibility(0);
        this.dXF = (MaterialProgressBarCycle) this.mRootView.findViewById(R.id.public_feedback_circle_progressBar);
        if (this.dXF != null) {
            this.dXF.setVisibility(8);
        }
        this.frq.bsn().frA = this.frA;
        this.zo = this.mTitleBar.qN;
        if (!TextUtils.isEmpty(this.frx)) {
            this.zo.setText(this.frx);
        }
        this.eCE.setOnClickListener(this);
        lvw.cm(this.mTitleBar.gBE);
        lvw.c(getWindow(), true);
        lvw.d(getWindow(), true);
        if (!cqt.asq()) {
            dwp.lU("component_page_help_show");
        }
    }

    public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
        return false;
    }

    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i != 4) {
            return super.onKeyDown(i, keyEvent);
        }
        this.eCE.performClick();
        return true;
    }
}